<admintpl file="header" />
</head>
<body>
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a href="{:U('Desktop/index')}">素材管理</a></li>
            <li><a href="{:U('Desktop/add')}">添加素材</a></li>
        </ul>
        <form class="well form-search js-ajax-form" method="post" action="{:U('Desktop/index')}">
            素材类型：
            <select name="dtype" style="width: 80px;">
                <foreach name="type" item="vo">
                    <option <if condition="(I('param.dtype') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            素材状态：
            <select name="dstatus" style="width: 80px;">
                <foreach name="status" item="vo">
                    <option <if condition="(I('param.dstatus') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            素材名称：
            <input type="text" name="keyword" style="width: 140px;" value="{:I('param.keyword')}" placeholder="请输入查询内容...">
            使用时间：
            <input type="text" name="start_time" class="js-datetime" value="{:I('param.start_time')}" style="width: 120px;" autocomplete="off"> ~
            <input type="text" name="end_time" class="js-datetime"  value="{:I('param.end_time')}" style="width: 120px;" autocomplete="off">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$count" >共查询到 {$count} 条数据</if>
        </form>
            <div class="pagination">{$page}</div>
			<table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th width="60">id</th>
                        <th>名称</th>
						<th>描述</th>
                        <th width="50">预览</th>
                        <th>类型</th>
                        <th>状态</th>
                        <th>有效期</th>
                        <th>操作人</th>
                        <th width="110">操作</th>
                    </tr>
                </thead>
                <foreach name="game" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.introduction}</td>
	                    <td style="padding: 0;margin: 0;"><if condition="$vo['local_file'] && $vo['dtype'] eq 2"><img src="{$urlimg}{$vo.local_file}" name="{$urlimg}{$vo.local_file}" title="双击查看" ondblclick="image_priview(this.name);" ></if></td>
						<td>{$type[$vo['dtype']]['name']}</td>
						<td>{$status[$vo['dstatus']]['name']}</td>
						<td>{$vo.start_at} ~ {$vo.end_at}</td>
						<td><foreach name="users" item="user"><if condition="$vo['userid'] eq $user['id']">{$user.user_login}</if></foreach></td>
                        <td>
							<if condition="$vo['dstatus'] eq 1">
								<a href="{:U('Desktop/up',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要启用素材吗？">未启用 </a>
							</if>
							<if condition="$vo['dstatus'] eq 2">
								<a href="{:U('Desktop/down',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要停用素材吗？" style="color: #FF0000;"><b>已启用</b></a>
							</if>
							<if condition="$vo['dstatus'] eq 3">
								<a href="{:U('Desktop/up',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要启用素材吗？">已停用 </a>
							</if>
							| <a href="{:U('Desktop/edit', array('id'=>$vo['id']))}">{:L('EDIT')}</a>
							| <a href="{:U('Desktop/delete', array('id'=>$vo['id']))}"class="js-ajax-delete">{:L('DELETE')}</a>
                        </td>
                    </tr>
                </foreach>
                <thead>
                    <tr>
                        <th width="60">id</th>
                        <th>名称</th>
						<th>描述</th>
                        <th width="50">预览</th>
                        <th>类型</th>
                        <th>状态</th>
                        <th>有效期</th>
                        <th>操作人</th>
                        <th width="110">操作</th>
                    </tr>
                </thead>
            </table>
            <div class="pagination">{$page}</div>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
</body>
</html>
